import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
Vue.use(VueRouter);

const routes = [{
    path: "/",
    redirect: "/home", // 重定向:重新指向其它path,会改变网址
  },
  {
    path: "/home",
    name: "Home",
    component: Home,
    children: [{
        path: "/",
        redirect: "/home/article",
      },
      {
        path: "/home/article",
        name: "article",
        component: () =>
          import( /* webpackChunkName: "about" */ "../views/home/Article.vue"),
      },
      {
        path: "/home/archives",
        name: "archives",
        component: () =>
          import( /* webpackChunkName: "about" */ "../views/home/Archives.vue"),
      },
      {
        path: "/home/knowledge",
        name: "knowledge",
        component: () =>
          import( /* webpackChunkName: "about" */ "../views/home/Knowledge.vue"),
      },
      {
        path: "/detail/:id",
        name: "detail",
        component: () =>
          import( /* webpackChunkName: "about" */ "../views/home/Detail.vue"),
      },
      {
        path: "/tabdetail/:id",
        name: "tabdetail",
        component: () =>
          import( /* webpackChunkName: "about" */ "../views/home/tabDetail.vue"),
      },
      {
        path: "/knowDet/:id",
        name: "knowDet",
        component: () =>
          import( /* webpackChunkName: "about" */ "../views/home/knowDet.vue"),
      },
      {
        path: "/tagdetail/:id",
        name: "tagdetail",
        component: () =>
          import( /* webpackChunkName: "about" */ "../views/home/tagDetail.vue"),
      },
      {
        path: "/detail/:id",
        name: "detail",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/Detail.vue"),
      },
      {
        path: "/tabdetail/:id",
        name: "tabdetail",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/tabDetail.vue"),
      },
      {
        path: "/knowDet/:id",
        name: "knowDet",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/knowDet.vue"),
      },
      {
        path: "/tagdetail/:id",
        name: "tagdetail",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/tagDetail.vue"),
      },
      {
        path: "/detail/:id",
        name: "detail",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/Detail.vue"),
      },
      {
        path: "/tabdetail/:id",
        name: "tabdetail",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/tabDetail.vue"),
      },
      {
        path: "/knowDet/:id",
        name: "knowDet",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/knowDet.vue"),
      },
      {
        path: "/tagdetail/:id",
        name: "tagdetail",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/tagDetail.vue"),
      },
      {
        path: "/detail/:id",
        name: "detail",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/Detail.vue"),
      },
      {
        path: "/tabdetail/:id",
        name: "tabdetail",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/tabDetail.vue"),
      },
      {
        path: "/knowDet/:id",
        name: "knowDet",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/knowDet.vue"),
      },
      {
        path: "/tagdetail/:id",
        name: "tagdetail",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/tagDetail.vue"),
      },
    ],
  },
  {
    path: "/about",
    name: "About",
    component: () =>
      import( /* webpackChunkName: "about" */ "../views/About.vue"),
  },
  {
    path: "/searchbox",
    name: "searchbox",
    component: () =>
      import( /* webpackChunkName: "about" */ "../views/Searchbox.vue"),
  },
  {
    path: "/searchbox",
    name: "searchbox",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Searchbox.vue"),
  },
  {
    path: "/searchbox",
    name: "searchbox",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Searchbox.vue"),
  },
  {
    path: "/searchbox",
    name: "searchbox",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Searchbox.vue"),
  },
  {
    path: "*",
    name: "eorry",
    component: () =>
      import( /* webpackChunkName: "about" */ "../views/Eorry404.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;